local AddMessagePanel = require "View/UIFriend/UIFriendAddMessagePanel"

---@class UIFriendApplyMessage : UIBase
UIFriendApplyMessage = UIBase.New(PanelResNames.UIFriendApplyMessage)
local t = UIFriendApplyMessage

function t.Init(friendId)
    t.friendId = friendId
    UIBase.Init(t)
end

function t:OnCreate()
    ---@type UIFriendAddMessagePanel
    self.addMessagePanel = AddMessagePanel.New(self.fguiObj)
    self:RegisterEvent(Config.EventType.FriendShowAddMessage,self.ClickClose)

end

function t:OnEnable()
    self:Refresh()
end
function t:OnDisable()
end
function t:OnDestroy()
    self.addMessagePanel:Destroy()
end
function t:Refresh()
    self.addMessagePanel:Refresh(t.friendId)
end
function t:ClickClose()
    closeUI(PanelResNames.UIFriendApplyMessage)
end
return t